package com.advert.presentation.util;

import java.util.HashMap;
import java.util.Map;

public class InitParameters {
    private Map<InitParameter, String> map = new HashMap<InitParameter, String>();

    public InitParameters(Map<String, String> parameters) {
        if (parameters != null) {
            for (Map.Entry<String, String> entry : parameters.entrySet()) {
                try {
                    InitParameter parameter = InitParameter.valueOf(entry.getKey());
                    if (parameter != null) {
                        map.put(parameter, entry.getValue());
                    }
                } catch (IllegalArgumentException e) {}
            }
        }
    }
    

    public String get(InitParameter parameter) {
        String retVal = map.get(parameter);
        if (retVal == null) {
            retVal = "";
        }

        return retVal;
    }
}
